Option Explicit
Sub J_Sample001()
    Dim myDlg As Dialog
    Dim i     As Long
    For i = 0 To 1000
        Set myDlg = Nothing
        On Error Resume Next
        Set myDlg = Application.Dialogs(i)
        On Error GoTo 0
        If myDlg Is Nothing Then
        Else
            On Error Resume Next
            myDlg.Show
            On Error GoTo 0
            If MsgBox("n~ܡH", vbYesNo) = vbNo Then Exit Sub
        End If
    Next
    Set myDlg = Nothing				'
End Sub
